package com.zlt.controller.recruiter;

import com.zlt.controller.BaseController;
import com.zlt.service.RecruiteMenuService;
import com.zlt.service.impl.RecruiteMenuServiceImpl;
import com.zlt.vo.RecruiteMenuVo;
import com.zlt.vo.Result;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/recruiter/menu/*")
public class RecruiteMenuController extends BaseController {

    /**
     * 这是招聘者菜单管理
     */
    private RecruiteMenuService recruiteMenuService=new RecruiteMenuServiceImpl();

    @Override
    protected void defaultMethod(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }

    /**
     * 获取招聘者的菜单
     * @param request
     * @param response
     * @return
     * @throws ServletException
     * @throws IOException
     */
    protected Result menu(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        RecruiteMenuVo recruiteMenuVo=recruiteMenuService.selectRecruiteMenu();
        if(recruiteMenuVo!=null) {
            System.out.println("recruiteMenuVo=="+recruiteMenuVo.toString());
            return Result.ok("查询成功", recruiteMenuVo);
        }
        return Result.error("查询失败");
    }
}
